package com.fosss.band.utils;

import com.fosss.band.entity.User;

/**
 * @author: fosss
 * Date: 2024/1/9
 * Time: 14:40
 * Description:
 */
public class ThreadLocalUtil {
    private static final ThreadLocal<User> threadLocal = new ThreadLocal<>();

    public static void set(User user) {
        threadLocal.set(user);
    }

    public static User get() {
        return threadLocal.get();
    }

    public static void clear() {
        threadLocal.remove();
    }
}
